<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8"/>
    <title>exam</title>
    <script src="../../public/lib/phaser.js"></script>
</head>
<body>

<script>

    let game = new Phaser.Game({
        type: Phaser.AUTO,
        width: 800,
        height: 600,
        //物理引擎
        physics: {
            default: 'arcade',
            arcade: {
                //重力设置
                gravity: {y: 300},
                debug: false
            }
        },
        //场景设置
        scene: {
            preload,
            create,
            update
        }

    });

    function preload () {
        this.load.image('sky', 'assets/sky.png');
        this.load.image('ground', 'assets/platform.png');
        this.load.image('star', 'assets/star.png');

    }

    function create () {

        // game.physics.startSystem(Phaser.Physics.ARCADE);
        this.add.sprite(0, 0, 'sky');
        this.add.sprite(0,0,'ground');

    }

    function update () {
        this.find('ground').x += 1;
    }



</script>

</body>
</html>